package com.qingcheng.dao;

import com.qingcheng.pojo.system.AdminRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface AdminRoleMapper extends Mapper<AdminRole> {

    @Insert("INSERT INTO tb_admin_role VALUES(#{adminId},#{roleId})")
    public void add(@Param("adminId") Integer adminId, @Param("roleId")Integer roleId);

    @Select("SELECT role_id FROM tb_admin_role WHERE admin_id=#{adminId}")
    public List<Integer> findById(@Param("adminId")Integer adminId);

    @Delete("DELETE FROM tb_admin_role WHERE admin_id=#{adminId}")
    public void deleteById(@Param("adminId")Integer adminId);
}
